//---------------------------------------------------------------------------

#ifndef CenterEditH
#define CenterEditH
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>

void SetupMemo(TObject* Memo, int length = 0)
{
  TMemo* Memo1 = (TMemo*)Memo;
  Memo1->Alignment = taCenter;
  Memo1->WantReturns = false;
  Memo1->WordWrap = false;
  Memo1->HideSelection = true;
  
  if(length>0)
  {
        Memo1->MaxLength = length; 
  }
}
void MultiLineMemoToSingleLine(TObject* Memo)
{
  String t;
  t = ((TMemo*)Memo)->Text;
  if(t.Pos("\n") > 0)
  {
    while(t.Pos("\n") > 0)
      t = t.Delete(t.Pos("\n"), 1);
    while(t.Pos("\r") > 0)
      t = t.Delete(t.Pos("\r"), 1);
    ((TMemo*)Memo)->Text = t;
  }
}

//------------------------------------------------------------------------
#endif
